import request from '@/services/request'

// 获取相关推荐
export const getRecommendInfo = async (id, options = {}) => {
  return await request.get(`/v3/web/api/recommend/${id}`, {}, options)
}

// 点播观看上报
export const reportVodData = async cid => {
  return await request.post('/metrics/v1/play', { cid })
}

// 获取点播下有哪些演员
export const getRelatedActor = async (cid, options = {}) => {
  return await request.get(`/metadata/v1/collection/actors/${cid}`, {}, options)
}

// 获取演员所选择的专辑
export const getCollectionFromActor = async (id, options = {}) => {
  return await request.get(`/metadata/v1/actor/collection/${id}`, {}, options)
}

// 获取演员信息
export const getActorInfo = async (id, options = {}) => {
  return await request.get(`/metadata/v1/actor/info/${id}`, {}, options)
}

// 搜索演员信息
export const getActorInfoBySearch = async (word, options = {}) => {
  return await request.get('/metadata/v1/actor/searchActor', { word }, options)
}

// 多线路获取&&专辑详情信息
export const getVodCollection = async (cid, options) => {
  return await request.get(`/web/v2/dianbo/collection/${cid}`, {}, options)
}

// 老id转换为新id
export const oldIdToNewId = async cid => {
  return await request.get(`/web/v2/dianbo/collection/transfer/${cid}`)
}

// 获取最佳线路
export const getVipLine = async (cid, params) => {
  return await request.get(`/web/v2/dianbo/vcollection/${cid}`, params)
}

//点播求片
export const dianboGetSource = async data => {
  return await request.post('/metadata/v1/collection/video/record', data)
}

// 通过eporder cid获取播放url
export const fetchPlayUrl = async data => {
  return await request.post('/web/v2/dianbo/video/line', data)
}

// 获取点播播放线路
export const getVodCollectionLines = async data => {
  return await request.post('/web/v2/dianbo/collection/line', data)
}

// 获取下载链接
export const getLink = async id => {
  return await request.get(`/api/marketing/apkLink/${id}`)
}

// 上报点击链接
export const reportLink = async data => {
  return await request.post('/api/marketing/linkPost',data)
}